/// @tags: DP Greedy
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>

using std::cin;
using std::cout;
using std::pair;
using std::vector;

namespace BlueQuantum {

typedef long long LL;

constexpr int N = 1e5 + 3;

int n, m, X, A, a[N], sum[N], b[51], h[51], f[51][51], tag[N];

pair<vector<int>, int> g[51][51];

pair<int, vector<int> > check(int l, int r, int A, int lim) {
  std::priority_queue<pair<int, int> > pq;
  int cnt = 0;
  vector<int> vec;
  for (int i = l; i <= r; ++i) {
    tag[i] = 0;
    pq.emplace(a[i] + X, i);
    cnt++;
    if (A - X < 0 && !pq.empty()) {
      A += pq.top().first;
      pq.pop();
      cnt--;
    }
    A -= X;
  }
  if (cnt < lim) return make_pair(-1, vec);
  while (cnt > lim) A += pq.top().first, pq.pop(), cnt--;
  while (!pq.empty()) tag[pq.top().second] = 1, pq.pop();
  for (int i = l; i <= r; ++i)
    if (!tag[i]) vec.push_back(i);
  return make_pair(A, vec);
}

inline int main() {
  cin >> n >> m >> X >> A;
  for (int i = 1; i <= n; ++i) cin >> a[i], sum[i] = sum[i - 1] + a[i];
  for (int i = 1; i <= m; ++i) cin >> b[i] >> h[i];
  memset(f, -1, sizeof(f));
  f[0][0] = A;
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j <= i; ++j)
      if (f[i][j] >= 0) {
        auto tmp = check(b[i] + 1, b[i + 1], f[i][j], h[i + 1]);
        if (tmp.first >= 0) {
          if (f[i + 1][j + 1] < tmp.first) {
            f[i + 1][j + 1] = tmp.first;
            g[i + 1][j + 1] = make_pair(tmp.second, j);
          }
        }
        if (sum[b[i + 1]] - sum[b[i]] + f[i][j] > f[i + 1][j]) {
          f[i + 1][j] = sum[b[i + 1]] - sum[b[i]] + f[i][j];
          vector<int> vec;
          for (int k = b[i] + 1; k <= b[i + 1]; ++k) vec.push_back(k);
          g[i + 1][j] = make_pair(vec, j);
        }
      }
    for (int j = i; j >= 0; --j)
      if (f[i + 1][j + 1] > f[i + 1][j])
        f[i + 1][j] = f[i + 1][j + 1], g[i + 1][j] = g[i + 1][j + 1];
  }
  for (int i = m; i >= 0; --i)
    if (f[m][i] >= 0) {
      cout << i << '\n';
      int cur = m, pos = i;
      vector<int> ans;
      while (cur) {
        for (auto x : g[cur][pos].first) ans.push_back(x);
        pos = g[cur--][pos].second;
      }
      cout << ans.size() << '\n';
      std::sort(ans.begin(), ans.end());
      for (auto x : ans) cout << x << ' ';
      return 0;
    }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("sequence.in", "r", stdin);
  freopen("sequence.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
